<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/cases/hear/";  //应用的地址名
String llegalRegActionName = basePath+"CaseSourceHear_llegalReg.action";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>审理情况登记</title>
<script type="text/javascript">
<!--
           $(function(){
              /*
               $('#vcName').validatebox({
                   required:'true',
                   missingMessage:'必须输入名称',
                   validType:'length[1,100]'
               });
               */
               $('td[id="count"]').find('input[type="text"]').each(function(){
            	   $(this).blur(function(){
            		   calc('count');
            	   });
               });
               $('td[id="money"]').find('input[type="text"]').each(function(){
            	   $(this).blur(function(){
            		   calc('money');
            	   });
               });
               $(':input','.tb_add_th').numberbox({
                   missingMessage:'请输入合法的数字！'
               });
	           //点击添加按钮操作
			   $('#addBtn').click(function(){
                  $('#editForm').submit();
	            });
	            //表单验证及提交处理操作
	           $('#editForm').form({
			        url:'<%=llegalRegActionName%>',
			        onSubmit: function(){
			           if($(this).form('validate')){
			                 $.util.showLoading();
			                 $('#operateWindow').window('close');
                            return true;
			             }else{
			                return false;
			             }
			        },
			        success:function(data){
			            $.util.removeLoading();
                        returnOptMsg(data);
			        }
				});
	            
           });
   function calc(flag){
	   var temp=0;
	   $('td[id="'+flag+'"]').find('input[type="text"]').each(function(){
		   if($(this).val()!="")
			   temp=temp+parseInt($(this).val());
       });
	   if(flag=='count'){
		 $('#totalCount').val(temp);
		 $('#countText').text(temp);
	   }else if(flag=='money'){
		 $('#totalMoney').val(temp);
		 $('#moneyText').text(temp);
	   }
	     
}
//-->
</script>
  </head>
  <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >
    <s:form action="editForm" method="post">
    <s:hidden name="po.vcId"/>
    <s:hidden name="po.caseId"/>
    <s:hidden id="totalMoney"  name="po.totalMoney" />
    <s:hidden id="totalCount"  name="po.totalCount"/>
	<table align="center" class="tb_add_th" width="100%">
	    <tr><th></th>
	         <th style="text-align:left;width:200px;">查处发票份数（份）</th>
		     <th style="text-align:left;width:200px;">涉及金额（元）</th>
		 </tr>
		<tr><th>交通运输</th><td id="count"><s:textfield id="transportCount"  name="po.transportCount" style="width:100px;"/></td>
		                    <td id="money"><s:textfield id="transportMoney"  name="po.transportMoney" style="width:100px;"/></td></tr>
		
		<tr><th>建筑安装</th><td id="count"><s:textfield id="constructionCount"  name="po.constructionCount" style="width:100px;"/></td>
		    <td id="money"><s:textfield id="constructionMoney"  name="po.constructionMoney" style="width:100px;"/></td>
		</tr>
		
		<tr><th>商业零售</th><td id="count"><s:textfield id="commercialCount"  name="po.commercialCount" style="width:100px;"/></td>
		    <td id="money"><s:textfield id="commercialMoney"  name="po.commercialMoney" style="width:100px;"/></td>
		</tr>
		
		<tr><th>饮食服务</th><td id="count"><s:textfield id="cateringCount"  name="po.cateringCount" style="width:100px;"/></td>
		    <td id="money"><s:textfield id="cateringMoney"  name="po.cateringMoney" style="width:100px;"/></td>
		</tr>
		
		<tr><th>增值税专用发票</th><td id="count"><s:textfield id="addedTaxCount"  name="po.addedTaxCount" style="width:100px;"/></td>
		    <td id="money"><s:textfield id="addedTaxMoney"  name="po.addedTaxMoney" style="width:100px;"/></td>
		</tr>
		
		<tr><th>其他</th><td id="count"><s:textfield id="otherCount"  name="po.otherCount" style="width:100px;"/></td>
		    <td id="money"><s:textfield id="otherMoney"  name="po.otherMoney" style="width:100px;"/></td>
		</tr>
		
		<tr><th>小计</th><td id="countText"><s:property value="po.totalCount"/></td>
		    <td id="moneyText"><s:property value="po.totalMoney"/></td>
		</tr>
	</table>    
   </s:form>
  </body>
</html>

